############################################
############################################
## This Makefile is in chrge of building  ##
## the test for the format utility.       ##
############################################
############################################
#

# Header file for cunit
INC = -I /usr/include/CUnit/ -I ../../Src/Include/

# Compiler flags
CFLAGS = -Wall -pedantic 

# Compiler
CC = gcc

# libreria da testare
LIB_PATH = -L ../../lib/

.PHONY : test clean

format_test: ../../lib/libfat.a format_suite.o format_test.o 
	$(CC)  $(LIB_PATH) -o format_test $^ -lcunit -lfat 

format_test.o:  format_test.c
	$(CC) $(CFLAGS) $(INC) -c $<

format_suite.o: format_suite.c
	$(CC) $(CFLAGS) $(INC) -c $<

# Target di testing
test: format_test
	./format_test
	@echo -e "\n\n\a *** Test format superato! ***\n"	


clean:
	rm -f *.o
	rm -f format_test
	rm -f *~